/*
 *  UI_Rotate.cpp
 *
 *	Date: 2011-5-10
 *  Author: linshenqi
 */

#include "stdafx.h"
#include "./UI_Frame.h"

UI_Rotate::UI_Rotate(const CRect *pRect, const GRAPHICPROP *pProp)
	: GraphicBase(pRect, pProp)
{}

UI_Rotate::~UI_Rotate()
{}

bool UI_Rotate::OnPaint(CPaintDC *pDC, CDC *pMemDC)
{
	CPaintDC dc(this->m_pWnd);

	CRgn rgn;
	rgn.CreateEllipticRgn(this->m_pRect->left, this->m_pRect->top, this->m_pRect->right, this->m_pRect->bottom);
	dc.SelectClipRgn(&rgn, RGN_XOR);
	rgn.DeleteObject();
		
	this->SetDC(&dc);
	this->DrawBmp(this->m_pRect, &this->m_pBmp);
	
	return GraphicBase::OnPaint();
}

bool UI_Rotate::OnLButtonDown(UINT nFlags, CPoint point)
{
	return GraphicBase::OnLButtonDown(nFlags, point);
}

bool UI_Rotate::OnLButtonUp(UINT nFlags, CPoint point)
{
	return GraphicBase::OnLButtonUp(nFlags, point);
}

bool UI_Rotate::OnMouseMove(UINT nFlags, CPoint point)
{
	return GraphicBase::OnMouseMove(nFlags, point);
}

void UI_Rotate::SetRect(const CRect *pRect)
{
	GraphicBase::SetRect(pRect);
	this->SetBmp(BMP_ROTATE, pRect);
}

void UI_Rotate::Redraw()
{
	GraphicBase::Redraw();
}